import { createRouter, createWebHistory } from "vue-router"
import Layout from "@/views/layout/index.vue"
import Index from "@/views/index/index.vue"
import Page from "@/views/page/index.vue"
import User from "@/views/user/index.vue"
import Login from "@/views/login/index.vue"
import Project from "@/views/serve/project.vue"

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "layout",
      component: Layout,
      children: [
        { path: "/", name: "index", redirect: "/index" },
        { path: "/index", name: "home", component: Index },
        { path: "/page", name: "page", component: Page },
        { path: "/user", name: "user", component: User },
        { path: "/project", name: "project", component: Project },
      ],
    },
    { path: "/login", name: "login", component: Login },
  ],
})

export default router
